﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;

namespace CNStreaming
{
    public interface IStreamable
    {
        /// <summary>
        /// Serializes the object's data into the stream passed in.
        /// </summary>
        void toStream(MessageStream stream);

        /// <summary>
        /// Fills in the object's data from the stream passed in.
        /// </summary>
        void fromStream(MessageStream stream, int iVersion);

        /// <summary>
        /// Gets the version number. This should be updated if the format of the
        /// data being streamed changes.
        /// </summary>
        int getMessageVersion();
    }
}
